package com.zzt.mylotterykill.entity;

import com.zzt.mylotterykill.enums.GameEnum;
import com.zzt.mylotterykill.enums.OptionEnum;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Getter
@Setter
public class Option {
    private GameEnum game;
    private OptionEnum option;
    private String value;
    private BigDecimal odds;

    public static List<Option> getLhcOptions() {
        List<Option> options = new ArrayList<>();
        List<String> dxds = Arrays.asList("大","小","单","双");
        //选号正码1-6
        for (int i = 1; i < 7; i++) {
            for (int j = 1; j < 50; j++) {
                Option option = new Option(GameEnum.LHC,
                        OptionEnum.getByName("zmsame"+i),
                        String.valueOf("zmsame"+i + ":" + j),
                        new BigDecimal("8.044")
                        );
                options.add(option);
            }
        }
        //特码选号
        for (int i = 1; i < 50; i++) {
            Option option = new Option(GameEnum.LHC,
                    OptionEnum.TMSAME,
                    String.valueOf( OptionEnum.TMSAME.getName() +":"+ i),
                    new BigDecimal("48.265")
            );
            options.add(option);
        }
        //大小单双
        dxds.forEach( item ->{
            for (int i = 1; i < 7; i++) {
                Option option = new Option(GameEnum.LHC,
                        OptionEnum.getByName("zmdxds"+i),
                        String.valueOf("zmdxds"+i + ":" + item),
                        new BigDecimal("1.97")
                );
                options.add(option);
            }
            Option option = new Option(GameEnum.LHC,
                    OptionEnum.TMDXDS,
                    String.valueOf(OptionEnum.TMDXDS.getName() +":"+ item),
                    new BigDecimal("1.97")
            );
            options.add(option);
        } );
        return options;
    }

    public Option(GameEnum game, OptionEnum option, String value, BigDecimal odds) {
        this.game = game;
        this.option = option;
        this.value = value;
        this.odds = odds;
    }
}
